﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
        class Class1
        {
            private string username;
            private char usersex;
            private int userage;

            public string UserName
            {
                get { return this.username; }
                set
                {
                    if (value == "张三")
                    {
                        Console.WriteLine("输入错误");
                    }
                    else
                    {
                        username = value;
                    };
                }
            }
            public char UserSex
            {
                get { return this.usersex; }
                set
                {
                    if (value == '男' || value == '女')
                    {
                        usersex = value;
                    }
                    else
                    {
                        Console.WriteLine("输入错误");
                    }
                     
                }
            }
            public int UserAge
            {
                get { return this.userage; }
                set
                {
                    if (value > 0 && value < 150)
                    {
                        userage = value;
                    }
                    else
                    {
                        Console.WriteLine("输入错误");
                    }
                }
            }
       
        private int isbn;
        private string name;
        private double price;
        private string write;
        private string press;
        public int Isbn
        {
            get { return this.isbn; }
            set { isbn = value; }
        }
        public string Name
        {
            get { return this.name; }
            set
            {
                if (value == "张三")
                {
                    Console.WriteLine("输入错误");
                }
                else
                {
                    name = value;
                }
            }
        }
        public double Price
        {
            get { return this.Price; }
            set
            {
                if (value>=0&&value<=100)
                {
                    price = value;
                }
                else
                {
                    Console.WriteLine("输入错误");
                }
            } }
        public string Write { get {return this.write ; } set { write = value; } }
        public string Press { get {return this.press; } set  { press = value; } }

        private string cbsmc;
        private int telephone;
        private string address;
        public string Cbsmc  { get {return this.cbsmc; } set { cbsmc = value; } }
        public int Teltphone{ get { return this.telephone; }   set { telephone = value; }  }
        public string Address { get; set; }

        public void SayHello()
        {
            Console.WriteLine("用户的姓名为{0}，用户的性别是{1}，用户的年龄是{2}", this.username, this.usersex, this.userage);
        }
        public void Book()
        {
            Console.WriteLine("书本的图书编号为{0}，书本的名称为{1}，书本的价格为{2}，书本的作者是{3}，书本的出版社为{4}",this.isbn,this.name,this.press,this.write,this.press);
        }
        public void Cbs()
        {
            Console.WriteLine("出版社的名称是{0}，出版社的电话是{1}，出版社的地址是{2}", this.cbsmc,this.telephone,this.address);
            Console.ReadKey();
        }
        
        }
    
}
